FROM openjdk:8-jre-alpine
MAINTAINER "1142519971@qq.com"
# ENV PARAMS="" jar包运行时的环境变量需要可以自定义
ENV TZ=PRC

ENV JAVA_OPTS="-Dspring.config.location=file:/etc/gateway/conf/application.yml"
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone # 添加时区的概念
# 暴露端口号 表示当前应用程序服务器监听的端口号
EXPOSE 14384 15384
# 添加spring boot程序打包成的jar包
ADD target/api-gateway-center.jar /opt/gateway/api-gateway-center.jar
ADD src/main/resources/application.yml /etc/gateway/conf/application.yml
ENTRYPOINT ["sh","-c","java -jar $JAVA_OPTS /opt/gateway/api-gateway-center.jar"]